﻿using TaoSH.AppCode;
using TaoSH.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TaoSH.View
{
    public partial class GGGL : FormUControl
    {




        #region//添加页面



        public override void initALLForm(string strFormCode)
        {
            new CommonHelp.BindData().BindSPLB(conLBName);
            conLBName.Items.Insert(0, new ListItem("首页广告", "首页广告"));

        }


        public override void initAddForm(string strFormCode)
        {

        }




        /// <summary>
        /// 送审表单
        /// </summary>
        /// <param name="FormID">表单号</param>
        /// <param name="intProcessInstanceID">流程号</param>
        /// <returns></returns>
        public override bool SaveForm(int intFormID, string strActionType)
        {
            PT_Info_Advert MODEL = new PT_Info_Advert();
            MODEL = new PT_Info_AdvertB().GetEntity(d => d.ID == intFormID);
            MODEL.Type = conLBName.SelectedValue;
            MODEL.Title = conTitle.Text;
            MODEL.SortBy = int.Parse(conLBOrder.Text);
            MODEL.ImgUrl = conGGTP.Value.Split(',')[0];
            MODEL.Details = conSPID.Text;
            
            return new PT_Info_AdvertB().Update(MODEL);
        }
        #endregion

        #region//查看页面
        /// <summary>
        /// 初始化View页面
        /// </summary>
        /// <param name="intFormID">表单号</param>
        public override void initMangerForm(int intFormID)
        {
            PT_Info_Advert MODEL = new PT_Info_Advert();
            MODEL = new PT_Info_AdvertB().GetEntity(d => d.ID == intFormID);
            conLBName.SelectedValue = MODEL.Type;
            conTitle.Text = MODEL.Title;
            conLBOrder.Text = MODEL.SortBy.ToString();
            conGGTP.Value = MODEL.ImgUrl;
            conSPID.Text = MODEL.Details;
        }

        #endregion





    }
}